﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Cherry.Agile.ServiceModel.Config {
    partial class RempServiceModelSection {

        static Lazy<RempServiceModelSection> __val = new Lazy<RempServiceModelSection>(() => {
            var file = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "servicemodel.config");
            if (File.Exists(file)) {
                var cfg = Configuration.ConfigManager.Create(file);
                return cfg.GetSection("remp.serviceModel") as RempServiceModelSection;
            } else {
                return RempServiceModelSection.Instance;
            }

        });

        public static RempServiceModelSection Current {
            get {return __val.Value;}
        }
    }
}
